package cs340.stormtroopers.phase2Tests;

import junit.framework.TestCase;
import cs340.stormtroopers.hypeerweb.*;

public class FoldTest extends TestCase
{
	public void testTest(){
		HyPeerWeb h = HyPeerWeb.getSingleton();
		Node n0 = new Node(0);
		Node n1 = new Node(1);
		Node n2 = new Node(2);
		Node n3 = new Node(3);
		Node n4 = new Node(4);
		Node n5 = new Node(5);
		Node n6 = new Node(6);
		Node n7 = new Node(7);
		Node n8 = new Node(8);
		n0.printFold();
		
		h.addToHyPeerWeb(n0, null);
		n0.printFold();
		h.addToHyPeerWeb(n1, null);
		n0.printFold();
		h.addToHyPeerWeb(n2, null);
		n0.printFold();
		h.addToHyPeerWeb(n3, null);
		n0.printFold();
		h.addToHyPeerWeb(n4, null);
		n0.printFold();
		h.addToHyPeerWeb(n5, null);
		n0.printFold();
		h.addToHyPeerWeb(n6, null);
		n0.printFold();
		h.addToHyPeerWeb(n7, null);
		n0.printFold();
		h.addToHyPeerWeb(n8, null);
		n0.printFold();
		
		assertTrue(h.size()==9);
		assertTrue(h.contains(n0));
		assertTrue(h.contains(n1));
		assertTrue(h.contains(n2));
		assertTrue(h.contains(n3));
		assertTrue(h.contains(n4));
		assertTrue(h.contains(n5));
		assertTrue(h.contains(n6));
		assertTrue(h.contains(n7));
		assertTrue(h.contains(n8));
	}
}
